package cn.patpang.core.framework.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * Created by maywant on 2017/7/11.
 */
@MappedSuperclass
@Data
public abstract class BaseEntity implements Serializable {

    @ApiModelProperty("新增时( id=0 || id=null)")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @NotNull(message = "900001", groups = {ValidGroup.Update.class})
    protected Integer id;

}